UpdateMgr = {};

local updateDic = {};

function UpdateMgr:update()
    for i, v in pairs(updateDic) do
        if v ~= nil then
            v[1](table.unpack(v[2]));
        end
    end
end

function UpdateMgr:add(handler, ...)
    updateDic[handler] = { handler, { ... } };
    return handler;
end

function UpdateMgr:remove(handler)
    updateDic[handler] = nil;
end